include ../../tools/makedefaults.inc

INCLUDES = -I../inc
PRINTFOP = -Wl,-u,vfprintf -lprintf_flt -lm
LDFLAGS = $(PRINTFOP)

HLNAME = ../../bin/libhappy
HLLIB = $(HLNAME).a

# Library source files
SRC = 	async_printf.c \
		 	pid.c \
			irdist.c \
			confdb.c \
			happylib.c \
			motor_group.c \
			motion.c \

# Bootloader object files
OBJ = $(SRC:.c=.o)

all: $(HLLIB)

%.o: %.c
	@echo " - Compiling $@"
	@$(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@

$(HLLIB): $(OBJ)
	@echo " - Archiving" $@
	@$(AR) rcs $@ $(OBJ)

clean:
	@echo " - Cleaning objects"
	@rm -f $(OBJ) $(HLLIB)
